package com.project.authorizationserver.controller;

import com.project.base.Result;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/test")
public class Controller {

    @Resource
    private BCryptPasswordEncoder passwordEncoder;

    @RequestMapping("/test")
    public Result test() {
        String encode = passwordEncoder.encode("123");
        boolean matches = passwordEncoder.matches("123", encode);
        return Result.success(matches);
    }


}
